package com.mmz.gulimall.ware.dao;

import com.mmz.gulimall.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mmz.gulimall.ware.vo.SkuHasStockVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 *
 * @author yangzhenjiang
 * @email 1983337308@qq.com
 * @date 2020-07-28 16:10:39
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {
    void addStock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("skuNum") Integer skuNum);

    /**
     * 查询商品的库存
     * @param skuId 商品ID
     * @return
     */
    Long getSkuStock(@Param("skuId") Long skuId);
}
